package com.hank.snakegame;


import java.awt.*;
import java.util.LinkedList;
import java.util.Random;

public class Food extends Cell{
    public Food(int x, int y, Color color) {
        super(x, y, color);
    }

    public static Food generateFood(LinkedList<Cell> excludeCells){
        while(true){
            Random random = new Random();
            Food newFood = new Food(random.nextInt(GamePanel.COL_NUM),random.nextInt(GamePanel.ROW_NUM),Color.BLACK);
            if(!excludeCells.contains(newFood)){
                return newFood;
            }
        }
    }
}
